#!/bin/ash -efu
#
# mki-invalidate-cache
#
# This file is part of mkimage
# Copyright (C) 2007-2009  Alexey Gladkov <gladkov.alexey@gmail.com>
#
# This file is covered by the GNU General Public License,
# which should be included with mkimage as the file COPYING.
#

. "${0%/*}"/mki-sh-functions

target=
[ "$#" -eq 0 ] ||
	target="$1"

verbose "has started executing${target:+ for '${target##*/}'}."

[ -d "$cachedir" ] ||
	exit 0

if [ -z "$target" ]; then
	find "$cachedir/" -mindepth 1 -maxdepth 1 -execdir rm -rf -- '{}' '+'
else
	rm -rf -- "$cachedir/$target"
fi
